;(function($){
	$.fn.csscard = function(options) {
		var defaults = {
				style:';min-width: 100px;max-width: 200px',
				linesize:38,
				sp:'<br/>'
		},
		options = $.extend(defaults,options);
		return this.each(function() {
			var $this = $(this),
			$card = $('<div class="css-card"></div>').attr('style',options.style||''),
			init = function(){
				$this.hover(function(){
					getCard();
					$card.show();
		       }, function(){
		      });
					$card.hover(function(){
		       }, function(){
		        $card.hide();
		      });
			},
			setCard = function(){
				  var msg =$this.attr('csscard')||'';
				  if(isnull(msg))return false;
				  msg = joinstr(msg,options.linesize,options.sp);
			      $this.prepend($card);
			      var js_html='<div class="wrapper"></div>';
						js_html+='<div class="u-info">';
						js_html+=msg;
						js_html+='</div><div class="u-close"></div>';
				$card.empty();
				$card.append(js_html);
				$('.u-close',$card).click(function(){
						$card.hide();
						return false;
				});
			},
			getCard = function(){
			    setCard();
			};		
			init();
		});
	};
	function isnull(str){
		return (str==null||str==""||str=="undefine");
	};
	function joinstr(str,len,sp){
		var arr = [];
		var row = str.length/len;
		for(var i=0;i<row;i++){
			var start = i*len;
			arr.push(str.substr(start,len));
		}
		return arr.join(sp);
	};
})(jQuery);